<?php
	class User_addres_model extends CI_Model {
		private $table_name="user_addres";
	public function get_addres_by_user_id($user_id){
		$query=$this->db->where('user_id',$user_id)->get($this->table_name);
		return $query->result();
	}
	public function saveaddress($name,$address,$phone,$user_id){
		$this->db->insert($this->table_name,array(
				'name'=>$name,
				'address'=>$address,
				'phone'=>$phone,
				'user_id'=>$user_id
			));
	}
}

    
